<!DOCTYPE html>
<html lang="en" xmlns:v-bind="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="node_modules/vue/dist/vue.js"></script>
    <!--active的class添加红色边框 -->
<style>
    .active{
        border: 1px solid red;
    }
</style>
</head>
<!--v-bind:属性名 为元素绑定属性   可简写为：属性名 -->
<body>
<div id="app">
    <img v-bind:src="imgSrc" alt="" v-bind:title="imgTitle" >
    <br>
<!--    简写v-bind设置元素属性-->
    <img v-bind:class="{active:isActive}" :src="imgSrc" :title="imgTitle" @click="changeClass">
<!--    利用：class和v-bind:class 改变元素样式-->
</div>
<script>
   var app=new Vue({
        el:"#app",
       data:{
            imgSrc:"img/monkey.gif",
           imgTitle:"这是图片",
           isActive:true
       },
       methods:{
            changeClass:function () {
                this.isActive=!this.isActive;
            }
   }
    })
</script>
</body>
</html>